<div class="content">
<h1>Sign up as a new user</h1>
<% @user.password = @user.password_confirmation = nil %>
<%= error_messages_for :user %>
<% form_for :user, :url => admin_users_path do |f| -%>
  <p><%= f.label User.human_attribute_name("email") %><br/>
  <%= f.text_field :email %></p>
  <p><%=f.label User.human_attribute_name("password")  %><br/>
  <%= f.password_field :password %></p>
  <p><%= f.label User.human_attribute_name("password_confirmation")  %><br/>
  <%= f.password_field :password_confirmation %></p>
  <p><%= f.label User.human_attribute_name("name")  %><br/><br/>
  <%= f.text_field :name %></p>
  <p><%=  f.label User.human_attribute_name("nickname")   %><br/>
  <%= f.text_field :nickname %></p>
  <p><%=  f.label User.human_attribute_name("introduction")   %><br/>
  <%= f.text_field :introduction %></p>
  <p><%=  f.label User.human_attribute_name("phone")   %><br/>
  <%= f.text_field :phone %></p>
  <p><%= f.label User.human_attribute_name("mobile")   %><br/>
  <%= f.text_field :mobile %></p>
  <p><%=  f.label User.human_attribute_name("address")   %><br/>
  <%= f.text_field :address %></p>
 <%= select_province_city("user",'province_id')%>
 <%= render :partial=>"shared/city_select" , :locals=>{:model=>'user' , :cities=>@cities ,:options=>{} ,:html_options=>{}} %>
 <%= render :partial=>"shared/district_select" , :locals=>{:model=>'user' , :districts=>@districts ,:options=>{} ,:html_options=>{}} %>
     <%Role.all.each do |role|%>
     <%= check_box_tag "user[role_ids][]", role.id, @user.roles.include?(role) %>
    <%= role.name %>
  <%end%>
  <p><%= submit_tag '提交' %></p>
<% end -%>
</div>